package pkmn.move.indirectAction;

import pkmn.Pokemon;
import pkmn.status.Status;
import pkmn.status.StatusEnum;
import pkmn.type.Poison;
import pkmn.type.Type;

public class ApplyPoison extends IndirectAction{

    public void execute(Pokemon pokemon) {
        for (Type type : pokemon.getTypes()){
            if (type.equals(new Poison())){
                System.out.println("But, it failed!");
                return;
            }
        }
        if (pokemon.getStatus().equals(StatusEnum.poison)){
            System.out.println(pokemon.getName() + " is already poisoned!");
        }else if (pokemon.getStatus().equals(StatusEnum.none)){
            pokemon.setStatus(new Status(StatusEnum.poison, -1));
            System.out.println(pokemon.getName() + " is poisoned!");
        }else
            System.out.println("But, it failed!");
    }
}
